/*
 * Created on Mar 19, 2005
 */
package org.vectrics.recruiter.job;

import org.vectrics.SystemException;


/**
 * @author MMoore
 */
public class JobSkillRatingSet {
	private Job job = null;
	private JobSkillRating rootRating = null; 
	
	public JobSkillRatingSet(Job job) {
		this.job = job;
	}

	public Job getJob() {
		return(job);
	}
	/**
	 * @return Returns the rootRating.
	 */
	public JobSkillRating getRootRating() {
		return rootRating;
	}
	
	public void setRootRating(JobSkillRating rootRating) {
		this.rootRating = rootRating;
		if (this.rootRating.getDescription() == null)
			this.rootRating.setDescription("Root rating for job: " + this.job.getTitle());
		//if (rootRating.getId() == null)
		//	rootRating.setId(CoreServiceLocator.getSurrogateKeyService().getKey("job.skill.id"));

		if (this.job == null)
			throw new SystemException("JobSkillRating needs job assigned before allowing root rating to be set.");
		this.rootRating.setJob(this.job);
	}
}
